﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Xml.Linq;
using System.Text.RegularExpressions;

/// <summary>
/// GoogleApiHelper 的摘要描述
/// </summary>
public class RegexHelper
{
    public static bool CheckTwAddress(string address)
    {
        //var pattern = @"(?<zipcode>(^\d{5}|^\d{3})?)(?<city>\D+[縣市])(?<district>\D+?(市區|鎮區|鎮市|[鄉鎮市區]))(?<others>.+)";
        var pattern = @"(?<city>\D+[縣市])(?<district>\D+?(市區|鎮區|鎮市|[鄉鎮市區]))(?<others>.+)";
        Match match = Regex.Match(address, pattern);

        return match.Success;
    }
}